﻿Imports System.Globalization
Imports System.Data
Imports System.Data.SqlClient

Partial Class Pages_MenuTest
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim tab As New DataTable
        Dim ds As New DataSet
        Dim con As New SqlConnection(ConfigurationManager.ConnectionStrings("DataHorejsi").ConnectionString)
        Dim cmd As New SqlCommand("SELECT DISTINCT Kategorie,indK FROM dbo.V_MenuProduktu", con)
        Dim cmdS As New SqlCommand("SELECT Kategorie,Subkategorie,WebURL,indK,indS FROM dbo.V_MenuProduktu", con)
        Dim dat1 As New SqlDataAdapter
        Dim ofsetfields As String = ""

        dat1.SelectCommand = cmd
        dat1.Fill(ds, "Kategorie")

        dat1.SelectCommand = cmdS
        dat1.Fill(ds, "Subkategorie")

        ds.Relations.Add("myrelation", ds.Tables("Kategorie").Columns("Kategorie"), ds.Tables("Subkategorie").Columns("Kategorie"))

        If CultureInfo.CurrentCulture.ToString = "en-US" Then ofsetfields = "EN"

        

        RPT_Kategorie.DataSource = ds.Tables("Kategorie")
        RPT_Kategorie.DataBind()
    End Sub
End Class
